home *** CD-ROM | disk | FTP | other *** search
- /* testall.mrbk */
-
- /* This ARexx program attempts to test all of MRBackup's ARexx
- * capabilities.
- *
- * Note: you will notice that several of MRBackup's ARexx commands
- * require syntax of the following form:
- *
- * 'somecommand "Quoted string"'
- *
- * This inhibits ARexx from evaluating the "Quoted string" and removing the
- * quotes.
- */
-
- signal on ERROR
- signal on BREAK_C
-
- options results
-
- if ~(Show('P', 'MRBackup_#1')) then do
- say "You must run MRBackup first. With a little work, you could"
- say "get this ARexx script to do it for you."
- exit 1
- end
-
- address "MRBackup_#1"
-
- poptofront /* Bring MRBackup's screen to the front. */
-
- 'setinfogadget "This is a test of MRBackup ARexx capabilities. Hold onto your hat!"'
- call Delay(50)
-
- /* Diddle the Test Date field. */
-
- 'gettestdate'
- msg = "Current test date = " || result
- say msg
- 'setinfogadget' '"'msg'"'
- call Delay(50)
- 'settestdate'
- 'gettestdate'
- msg = "New test date = " || result
- 'setinfogadget' '"'msg'"'
- call Delay(50)
-
- /* Muck about with the Home Path setting. */
-
- 'gethomepath'
- msg = "Current Home Path = " || result
- 'setinfogadget' '"'msg'"'
- call Delay(50)
-
- msg = "Setting Home Path to T:"
- 'setinfogadget' '"'msg'"'
- call Delay(50)
- 'sethomepath "T:"'
- call Delay(50)
-
- 'setinfogadget "Setting Home Path by requester."'
- call Delay(50)
- 'sethomepath'
- msg = "New Home Path = " || result
- 'setinfogadget' '"'msg'"'
- call Delay(50)
-
- 'setinfogadget "Setting Backup Path to SYS:"'
- call Delay(50)
- 'setbackpath "SYS:"'
- msg = "New Backup Path = " || result
- 'setinfogadget' '"'msg'"'
- call Delay(50)
-
- 'setinfogadget "Setting Backup Path by requester."'
- call Delay(50)
- 'setbackpath'
- msg = "New Backup Path = " || result
- 'setinfogadget' '"'msg'"'
- call Delay(50)
-
- 'setinfogadget "Setting Backup Filter"'
- 'setbfilterpath "BackupFilter"'
- call Delay(50)
-
- 'setinfogadget "Setting Backup Filter by requester."'
- call Delay(50)
- 'setbfilterpath'
- call Delay(50)
-
- 'notealert "Setting Compression Filter directly."'
- 'setcfilterpath "NoSuchFileName"'
- 'notealert "Setting Compression Filter by requester."'
- 'setcfilterpath'
- /*
- msg = "Final compression filter path is " || result
- 'notealert' '"'msg'"'
- */
- 'notealert "Setting decompression filter directly."'
- 'setdfilterpath "NoSuchFileName"'
- 'notealert "Setting decompression filter by requester."'
- 'setdfilterpath'
-
- /*
- msg = "Final decompression filter path is " || '0A'X || result
- 'notealert' '"'msg'"'
- */
-
- 'notealert "Setting listing path directly."'
- 'setlistpath "PRT:"'
- 'notealert "Setting listing path by requester."'
- 'setlistpath'
-
- 'notealert "Setting log path directly."'
- 'setlogpath "T:mrbackup.log"'
- 'notealert "Setting log path by requester."'
- 'setlogpath'
-
- 'setinfogadget "I will now toggle the button options"'
-
- 'notealert "Toggling the Voice option."'
- 'setvoice "no"'
- call Delay(50)
- 'setvoice "yes"'
- 'speak "If you can''t hear this, something is wrong."'
-
- 'notealert "Toggling the Listing option."'
- 'listing "no"'
- call Delay(50)
- 'listing "yes"'
-
- 'notealert "Toggling the Split Big Files option."'
- 'splitfiles "no"'
- call Delay(50)
- 'splitfiles "yes"'
-
- 'notealert "Toggling the Test Archive Bits option."'
- 'testarcbits "no"'
- call Delay(50)
- 'testarcbits "yes"'
-
- 'notealert "Toggling the Set Archive Bits option."'
- 'setarcbits "no"'
- call Delay(50)
- 'setarcbits "yes"'
- call Delay(50)
-
- 'notealert "Changing the buffer size."'
-
- 'getbufsize'
- msg = "Current buffer size = " || result || "K."
- 'notealert' '"'msg'"'
-
- 'setbufsize 64'
- msg = "New buffer size = " || result || "K."
- 'notealert' '"'msg'"'
-
- rc = 0
- 'setinfogadget "ARexx testing - cycling Compression and Decompression options."'
-
- getcompression
- say "Current compression option: " || result
-
- getdecompression
- say "Current decompression option: " || result
-
- /* Cycle through the allowable compression/decompression options. */
-
- coptions = ""
- coptions.1 = "None"
- coptions.2 = "12-Bit"
- coptions.3 = "13-Bit"
- coptions.4 = "14-Bit"
- coptions.5 = "15-Bit"
- coptions.6 = "16-Bit"
-
- do i=1 to 6
- /* say "i = " || i */
- /* say "coptions.i = " || coptions.i */
-
- /* say "Setting compression to " || coptions.i */
- setcompression coptions.i
- getcompression
- if result ~= coptions.i then do
- say "setcompression " || coptions.i " failed; rc = " || rc
- exit rc
- end
- /* say "Setting decompression to " || coptions.i */
- setdecompression coptions.i
- getdecompression
- if result ~= coptions.i then do
- say "setcompression " || coptions.i " failed; rc = " || rc
- exit rc
- end
- call Delay(50)
- end i
-
- 'speak "This is the end of the Ay Rexx demonstration and test."'
-
- 'setinfogadget "ARexx test complete."'
-
- exit 0
-
-
- /*------------------------------------------------------------------*/
-
- break_c:
-
- say "*** Control-C recieved. Stopped by user. ***"
- exit 5
-
- /*------------------------------------------------------------------*/
-
- error:
-
- say "Error"
- exit 6
-
- /*------------------------------------------------------------------*/
-
-